<!DOCTYPE html>

<html>
    <head>
        <title>littleware js Test Page</title>

        <link rel="stylesheet" href="http://yui.yahooapis.com/3.14.0/build/cssreset/cssreset.css" type="text/css" />
        <link rel="stylesheet" href="http://yui.yahooapis.com/3.14.0/build/cssbase/cssbase.css"  type="text/css" />
        <link rel="stylesheet" href="http://yui.yahooapis.com/3.14.0/build/cssfonts/cssfonts.css" type="text/css" />
        <link rel="stylesheet" href="http://yui.yahooapis.com/3.14.0/build/cssgrids/cssgrids.css" type="text/css" /> 

        <style id="yuiInsertBeforeMe" type="text/css">

            * {
                box-sizing:border-box;
            }
            
            body {
                margin: auto; /* center in viewport */
                /* width: 960px; */
                width:100%;
            }   
            
            div.content-box {
                padding:10px;
            }

        </style>

        <link rel="stylesheet" type="text/css" href="../resources/css/littleware/littleId.css" />
    </head>
    <body class="yui3-skin-sam">
    <div id='root'>
        <div class="yui3-g">
            <div class="yui3-u-1 content-box">

        <div id="intro">
            <h3>littleware js Test Page</h3>
        </div>

        <div id="pageStatus">
            <p>
                <img alt="waiting" src="../resources/img/wait.gif" /> Running tests ...
            </p>
        </div>
        <div id="littleIdUI" class="littleId_popup"></div>

        <script src="http://yui.yahooapis.com/3.14.0/build/yui/yui-debug.js"></script>
        <script src="../resources/js/littleware/littleYUI.js"></script>

        <script>
            littleware.littleYUI.bootstrap().use(
                'littleware-auth-authService', 'littleware-auth-authView', 'littleware-auth-littleId', 'test',
                function (Y) {
                    var logSrc = "testSuite.html";
                    littleware.auth = littleware.auth || {};
                    littleware.auth.littleId = Y.littleware.auth.littleId;

                    //var helper = Y.littleware.auth.littleId.helperFactory.get();
                    //helper.set('replyMethod', 'GET');

                    Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, 
                        function () {
                            Y.one("#pageStatus").setHTML("Test run complete");
                        }
                        );
                    if (typeof (window.callPhantom) != 'undefined') {
                        // phantomjs environment!
                        console.log("Phantomjs detected!");
                        Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, window.callPhantom);
                    }

                    Y.log( "We're up and running!", "info", logSrc );
                    var suite = new Y.Test.Suite( "littleware Test Suite" );
                    Y.log( "Test suite defined ok ..." );
                    //suite.add( Y.littleware.littleUtil.buildTestSuite() );
                    suite.add( Y.littleware.auth.littleId.buildTestSuite() );
                    suite.add(Y.littleware.auth.authService.buildTestSuite());
                    suite.add(Y.littleware.auth.authView.buildTestSuite());
                    Y.Test.Runner.add( suite );
                    Y.Test.Runner.run();
                }
            );
        </script>
    </div></div></div>
    </body>
</html>
